{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import yaml\n",
    "import numpy as np\n",
    "import matplotlib.pyplot as plt\n",
    "\n",
    "import tensorflow as tf\n",
    "\n",
    "from tensorflow_tts.configs import MultiBandMelGANGeneratorConfig\n",
    "\n",
    "from tensorflow_tts.models import TFMelGANGenerator\n",
    "from tensorflow_tts.models import TFPQMF"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "with open('../examples/multiband_melgan/conf/multiband_melgan.v1.yaml') as f:\n",
    "    config = yaml.load(f, Loader=yaml.Loader)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "config = MultiBandMelGANGeneratorConfig(**config[\"generator_params\"])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [],
   "source": [
    "class TFMBMelGANGenerator(TFMelGANGenerator):\n",
    "    def __init__(self, config, **kwargs):\n",
    "        super().__init__(config, **kwargs)\n",
    "        self.pqmf = TFPQMF(config=config, name='pqmf')\n",
    "        \n",
    "    def build(self, input_shape):\n",
    "        self.pqmf.build(input_shape)\n",
    "        self.built = True\n",
    "    \n",
    "    @tf.function(input_signature=[tf.TensorSpec(shape=[None, None, 80], dtype=tf.float32)])\n",
    "    def call(self, mels):\n",
    "        mb_audios = super().call(mels)\n",
    "        audios = self.pqmf.synthesis(mb_audios)\n",
    "        return audios"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [],
   "source": [
    "mb_melgan = TFMBMelGANGenerator(config, name=\"mb_melgan\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [],
   "source": [
    "fake_mels = tf.random.uniform(shape=[4, 256, 80], dtype=tf.float32)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [],
   "source": [
    "audios = mb_melgan(fake_mels)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Model: \"mb_melgan\"\n",
      "_________________________________________________________________\n",
      "Layer (type)                 Output Shape              Param #   \n",
      "=================================================================\n",
      "sequential (Sequential)      multiple                  2534356   \n",
      "_________________________________________________________________\n",
      "pqmf (TFPQMF)                multiple                  0         \n",
      "=================================================================\n",
      "Total params: 2,534,356\n",
      "Trainable params: 2,534,356\n",
      "Non-trainable params: 0\n",
      "_________________________________________________________________\n"
     ]
    }
   ],
   "source": [
    "mb_melgan.summary()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [],
   "source": [
    "mb_melgan.load_weights(\"../examples/multiband_melgan/checkpoints/generator-940000.h5\", by_name=True)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Save to Pb"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "WARNING:tensorflow:From /home/lap13839/anaconda3/envs/tensorflow-tts/lib/python3.7/site-packages/tensorflow/python/ops/resource_variable_ops.py:1817: calling BaseResourceVariable.__init__ (from tensorflow.python.ops.resource_variable_ops) with constraint is deprecated and will be removed in a future version.\n",
      "Instructions for updating:\n",
      "If using Keras pass *_constraint arguments to layers.\n",
      "INFO:tensorflow:Assets written to: ./mb_melgan/assets\n"
     ]
    }
   ],
   "source": [
    "tf.saved_model.save(mb_melgan, \"./mb_melgan\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Load and Inference"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [],
   "source": [
    "mb_melgan = tf.saved_model.load(\"./mb_melgan\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [],
   "source": [
    "mels = np.load(\"../dump/valid/norm-feats/LJ001-0009-norm-feats.npy\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [],
   "source": [
    "audios = mb_melgan(mels[None, ...])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[<matplotlib.lines.Line2D at 0x7f8d14204790>]"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXwAAAD4CAYAAADvsV2wAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuMCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy86wFpkAAAACXBIWXMAAAsTAAALEwEAmpwYAAA1SklEQVR4nO2dd3wVVdrHf08CAektIFIMHRERMAIWkCZNBd11dy37im3ZfV232d6oK2LXxVV3FyxYVnBXBduCC0oTRZEWmtRA6EEgoQcChMB5/7hzw+Rm5k470+48388nn8yde+6c586deeac5zyFhBBgGIZhUp80vwVgGIZhvIEVPsMwTERghc8wDBMRWOEzDMNEBFb4DMMwEaGK3wLo0ahRI5GVleW3GAzDMKFi2bJl+4QQmVrvBVbhZ2VlITc3128xGIZhQgURbdd7j006DMMwEYEVPsMwTERghc8wDBMRWOEzDMNEBFb4DMMwEYEVPsMwTERghc8wDBMRWOHbYF5eIQoOlvgtBsMwjCVY4dvgjn8uxZBXvvVbDIZhGEuwwrfJ0ZNlfovAMAxjCVb4DMMwEYEVvgNOnDrttwgMwzCmYYXvgOXbD/otAsMwjGlY4TvglTmb/BaBYRjGNKzwHXDkxCm/RWAYhjENK3wmVKzZdRjf5+/zWwyGCSWBLYASVIQQfosQaa79x3cAgG3PX+OzJAwTPniEb5Gl23ihlmGYcMIK3yLHSjngimGYcMIK3yLf5BX5LQLDMIwtWOFb5KPcneXbG/YU+ygJwzC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q7PUfYqv7GxEbXTzqQ/9XIjYt/QHASuVvGID3AKxW9k8D0FT1mUcVefOg8lzR+y6IeQ0sQWxx6SMA1STI3RoxL4RVANbG+0PM/jgXwCYAcwA0UPYTgPGKbKsBZKuOdaciWz6AO1T7sxG7yTYDGAcl0luC7DURG0XVVe0L3PlG7IG0G8ApxOy+d3lxfvX6cCBzPmJ26vj1HfdK+aly7awEsBzAdXZlS/b9Hcjt+jUBoLryOl95v7VbusbOH6dWYBiGiQipZtJhGIZhdGCFzzAMExFY4TMMw0QEVvgMwzARgRU+wzBMRGCFzzAMExFY4TMMw0SE/wc3UpCq2JcyJAAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.plot(audios[0, :, 0])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.7"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
